{{define "cp_core_settings"}}

{{template "cp_head" .}}
<header class="page-header">
    <h2>Control panel access</h2>
</header>


{{template "cp_alerts" .}}

<div class="row">
    <div class="col-lg-12">
        <form method="post" action="/manage/{{.ActiveGuild.ID}}/core" data-async-form>
            <div class="card card-featured card-featured-info">
                <header class="card-header">
                    <h2 class="card-title">Control panel access control</h2>
                </header>
                <div class="card-body">
                    <div class="form-group">
                        <label>Allow people with the following roles <code>read</code> access the control panel
                            </label><br>
                            <select class="multiselect" name="AllowedReadOnlyRoles" data-plugin-multiselect
                            multiple="multiple">
                            {{roleOptionsMulti .ActiveGuild.Roles nil .CoreConfig.AllowedReadOnlyRoles}}
                        </select>
                        <p class="help-block">Members with <code>Manage Server</code> perms can always access the
                            control panel</p>
                    </div>

                    <hr />

                    <div class="form-group">
                        <label>Allow people with the following roles <code>write</code> access the control
                            panel</label><br>
                        <select class="multiselect" name="AllowedWriteRoles" data-plugin-multiselect
                            multiple="multiple">
                            {{roleOptionsMulti .ActiveGuild.Roles nil .CoreConfig.AllowedWriteRoles}}
                        </select>
                        <p class="help-block">Members with <code>Manage Server</code> perms can always access the
                            control panel</p>
                    </div>

                    <hr />

                    <button type="submit" class="btn btn-success btn-lg btn-block">Save</button>
                </div>
            </div>
            <!-- /.panel -->
        </form>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- /.row -->

{{template "cp_footer" .}}

{{end}}
